package com.iuie.ns.frame.free.excel.beans;

import java.util.List;

import com.iuie.ns.frame.free.excel.enums.FreeExcelBodyStyle;
import com.iuie.ns.frame.free.excel.enums.FreeExcelHeaderStyle;
import com.iuie.ns.frame.utils.SheetColumnUtils;

/**
 * 工作表
 * @author liujie
 * @date 2018年5月13日下午4:35:17
 */
public class FreeExcelSheet {

	private FreeExcelSheet() {
		
	}
	
	public FreeExcelSheet newInstance() {
		return new FreeExcelSheet();
	}
	
	private String sheetName;
	
	private List<?> datas;
	
	private List<SheetColumn> headers;
	
	private FreeExcelHeaderStyle headerStyle;
	
	private FreeExcelBodyStyle bodyStyle;
	
	public FreeExcelSheet sheetName(String sheetName) {
		this.sheetName = sheetName;
		return this;
	}
	
	public <T> FreeExcelSheet datas(List<T> datas) {
		this.datas = datas;
		return this;
	}
	
	public FreeExcelSheet headers(Class<?> clazz) {
		this.headers = SheetColumnUtils.getSheetColumns(clazz);
		return this;
	}
	
	public FreeExcelSheet headers(List<SheetColumn> headers) {
		this.headers = headers;
		return this;
	}

	public FreeExcelSheet headerStyle(FreeExcelHeaderStyle headerStyle) {
		this.headerStyle = headerStyle;
		return this;
	}
	
	public FreeExcelSheet bodyStyle(FreeExcelBodyStyle bodyStyle) {
		this.bodyStyle = bodyStyle;
		return this;
	}
	
	public String getSheetName() {
		return sheetName;
	}

	public List<?> getDatas() {
		return datas;
	}

	public List<SheetColumn> getHeaders() {
		return headers;
	}

	public FreeExcelHeaderStyle getHeaderStyle() {
		return headerStyle;
	}

	public FreeExcelBodyStyle getBodyStyle() {
		return bodyStyle;
	}
	
}
